package com.common.android.utils.http;

import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.message.BasicHeader;
import org.apache.http.params.HttpConnectionParams;


/**
 * 为了适应服务端新接口用的COOKIE内容中的PHPSESSID改为OAPSID
 * 后面他们说会统一成OAPSID，但是鬼知道什么时候统一，跟他们反馈了也没用，擦
 * 服务端真无聊！！！！！！！！
 * ClassName:HttpClientExt
 * Function: TODO ADD FUNCTION
 * Reason:	 TODO ADD REASON
 * 
 * @author   黄永鑫		
 * @version  
 * @since    Ver 1.1
 * @Date	 2014	2014-2-28		下午2:29:55
 *
 * @see
 */
public class HttpClientExt extends HttpClient{
	public HttpClientExt(){
		super();
	}
	/**
     * 增加一个传参构造，区别于无参构造，获取支持https的client时用
     * Creates a new instance of HttpClient.
     * <br>Created 2014-9-25 上午9:55:36
     * @param httpsable
     */
	public HttpClientExt(int httpsable){
		super(httpsable);
	}

	@Override
	protected void setupHTTPConnectionParams(HttpUriRequest method) {
		// TODO Auto-generated method stub
		HttpConnectionParams.setConnectionTimeout(method.getParams(),CONNECTION_TIMEOUT_MS);
        HttpConnectionParams.setSoTimeout(method.getParams(), SOCKET_TIMEOUT_MS);
        method.addHeader("Accept-Encoding", "gzip, deflate");
        method.addHeader(new BasicHeader("COOKIE", "OAPSID="	+ sid + ""));
        method.addHeader(new BasicHeader("COOKIE", "PHPSESSID="	+ sid + ""));
	}
	
}
